


def dict_sort_by_value():
    d = {'a': 1, 'b': 4, 'c': 2}
    print sorted(d.items(), key=lambda x: x[1], reverse=True)

def dict_copy():
    d = {'a': 1, 'b': 4, 'c': 2}

    dd = dict(d)
    dd['a'] = 2
    print dd
    print d
if __name__ == '__main__':
    dict_sort_by_value()
    dict_copy()
